import { Redirect, IRouteComponentProps } from 'umi';

// 是可以用来做路由鉴权的
export default (props: IRouteComponentProps) => {
  if (localStorage.getItem('token')) {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to="/" />;
  }
};
